﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace fhe
{
  namespace math
  {
    public class Circle : IShape
    {
      public Vec2 Center { get; set; }

      public double Radius { get; set; }

      public bool Inside(Vec2 v)
      {
        return (v - Center).SquaredLength() < Radius * Radius;
      }

      public Vec2 SurfaceOffset(Vec2 v)
      {
        Vec2 diff = v - Center;
        return diff.Normalize() * (Radius - diff.Length());
      }
    }
  }
}
